<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.hz.model.Activity"%>
<%@page import="com.hz.control.ActivityControl"%>
<%@ page import="com.hz.util.ParamUtil"%>
<%@page import="com.hz.model.User"%>
<%@page import="com.hz.control.ActTypeControl"%>
<!DOCTYPE HTML>
<html>
  <head>
    <link rel="stylesheet" type="text/css" href="../../../css/active.css"/>
    <script type="text/javascript" src="../../../js/core.js"></script>
    <title>My JSP 'index.jsp' starting page</title>
    <style type="text/css">
	body{width:100%; height:100%; overflow:auto;border:0;}
</style>
  </head>  
  <body>
  <%
        request.setCharacterEncoding("utf-8");
        User cu = (User)session.getAttribute("user");
        %>
  <form>
  <%
     if(cu!=null&&cu.getRole()==1){
   %>
    <h1 class='title pr'>已举办活动<a href='../../admin/addActivity/activity_add_1.jsp'>记录</a></h1>
  <%}
        int pages = ParamUtil.getInt(request, "pages", 1);
		int rowsPerPage = ParamUtil.getInt(request, "pageSize", 10);
		//System.out.println(pages +"ddd" + rowsPerPage);
        Collection<Activity> as = ActivityControl.getActivities(pages,rowsPerPage);
        Iterator<Activity> itas = as.iterator();
        while(itas.hasNext()){
            Activity a = itas.next();
%>
<section class='section'>
<h1>标签：<%=ActTypeControl.getActTypeName(a.getActType()) %>、<%=a.getLeader() %>、<%=a.getPlace() %>、</h1>
<p class='name pr'><a class='list' href="actDetail.jsp?actid=<%=a.getId() %>"><%=a.getActName() %></a>
<span class='time pa'><%if(a.getEndTime()!=null&&a.getEndTime().length()>10)out.print(a.getEndTime().substring(0,10));else if(a.getEndTime()!=null)out.print(a.getEndTime());%></span></p>
</section>

     <%}%>

  <p class='bottom'>
  <%
     out.println(ActivityControl.pageInstance.getToolsMenu(pages));
  %>
   </p>

  
  </fieldset>
  </form>
  </body>
</html>
